/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyfntbpoa")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyfntbpoa.findAll", query = "SELECT p FROM Pyfntbpoa p"),
    @NamedQuery(name = "Pyfntbpoa.findByPyfntbpoaid", query = "SELECT p FROM Pyfntbpoa p WHERE p.pyfntbpoaid = :pyfntbpoaid"),
    @NamedQuery(name = "Pyfntbpoa.findByAnio", query = "SELECT p FROM Pyfntbpoa p WHERE p.anio = :anio"),
    @NamedQuery(name = "Pyfntbpoa.findByFechaemision", query = "SELECT p FROM Pyfntbpoa p WHERE p.fechaemision = :fechaemision"),
    @NamedQuery(name = "Pyfntbpoa.findByFechacierre", query = "SELECT p FROM Pyfntbpoa p WHERE p.fechacierre = :fechacierre"),
    @NamedQuery(name = "Pyfntbpoa.findByAprobacion", query = "SELECT p FROM Pyfntbpoa p WHERE p.aprobacion = :aprobacion"),
    @NamedQuery(name = "Pyfntbpoa.findByFecharegistro", query = "SELECT p FROM Pyfntbpoa p WHERE p.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Pyfntbpoa.findByObservaciones", query = "SELECT p FROM Pyfntbpoa p WHERE p.observaciones = :observaciones")})
public class Pyfntbpoa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyfntbpoaid")
    private Integer pyfntbpoaid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "anio")
    private int anio;
    @Column(name = "fechaemision")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaemision;
    @Column(name = "fechacierre")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechacierre;
    @Basic(optional = false)
    @NotNull
    @Column(name = "aprobacion")
    private boolean aprobacion;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbpoaid")
    private Collection<Pyfntbreqper> pyfntbreqperCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbpoaid")
    private Collection<Pyfntbpoaprog> pyfntbpoaprogCollection;

    public Pyfntbpoa() {
    }

    public Pyfntbpoa(Integer pyfntbpoaid) {
        this.pyfntbpoaid = pyfntbpoaid;
    }

    public Pyfntbpoa(Integer pyfntbpoaid, int anio, boolean aprobacion, Date fecharegistro, String observaciones) {
        this.pyfntbpoaid = pyfntbpoaid;
        this.anio = anio;
        this.aprobacion = aprobacion;
        this.fecharegistro = fecharegistro;
        this.observaciones = observaciones;
    }

    public Integer getPyfntbpoaid() {
        return pyfntbpoaid;
    }

    public void setPyfntbpoaid(Integer pyfntbpoaid) {
        this.pyfntbpoaid = pyfntbpoaid;
    }

    public int getAnio() {
        return anio;
    }

    public void setAnio(int anio) {
        this.anio = anio;
    }

    public Date getFechaemision() {
        return fechaemision;
    }

    public void setFechaemision(Date fechaemision) {
        this.fechaemision = fechaemision;
    }

    public Date getFechacierre() {
        return fechacierre;
    }

    public void setFechacierre(Date fechacierre) {
        this.fechacierre = fechacierre;
    }

    public boolean getAprobacion() {
        return aprobacion;
    }

    public void setAprobacion(boolean aprobacion) {
        this.aprobacion = aprobacion;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Pyfntbreqper> getPyfntbreqperCollection() {
        return pyfntbreqperCollection;
    }

    public void setPyfntbreqperCollection(Collection<Pyfntbreqper> pyfntbreqperCollection) {
        this.pyfntbreqperCollection = pyfntbreqperCollection;
    }

    @XmlTransient
    public Collection<Pyfntbpoaprog> getPyfntbpoaprogCollection() {
        return pyfntbpoaprogCollection;
    }

    public void setPyfntbpoaprogCollection(Collection<Pyfntbpoaprog> pyfntbpoaprogCollection) {
        this.pyfntbpoaprogCollection = pyfntbpoaprogCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyfntbpoaid != null ? pyfntbpoaid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyfntbpoa)) {
            return false;
        }
        Pyfntbpoa other = (Pyfntbpoa) object;
        if ((this.pyfntbpoaid == null && other.pyfntbpoaid != null) || (this.pyfntbpoaid != null && !this.pyfntbpoaid.equals(other.pyfntbpoaid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyfntbpoa[ pyfntbpoaid=" + pyfntbpoaid + " ]";
    }
    
}
